import type { MaFormItem } from "@mineadmin/form";
import hasAuth from "@/utils/permission/hasAuth.ts";
import MaUploadImage from "@/components/ma-upload-image/index.vue";
import { concat } from "lodash-es";

export default function getFormItems(
  formType: "add" | "edit" = "add",
  t: any,
  model: any
): MaFormItem[] {
  return concat([
    {
      label: "公司名称",
      prop: "name",
      render: "input",
      renderProps: { placeholder: t("form.pleaseInput", { msg: "公司名称" }) },
      itemProps: { rules: [{ required: true, message: "请输入公司名称" }] },
    },
    {
      label: "公司Logo",
      prop: "icon",
      render: () => MaUploadImage,
      renderProps: {
        title: "上传Logo",
        limit: 1,
        multiple: false,
      },
      // itemProps: { rules: [{ required: true, message: "请上传公司Logo" }] },
    },
  ]);
}
